
export const hasPermission = (btnPermissions) => {
    // 用户的权限码
    const userPermission = JSON.parse(localStorage.getItem("roles")) || []

    // 按钮所需单个权限code
    console.log(btnPermissions);
    console.log(Array.isArray(btnPermissions));
    if (!Array.isArray(btnPermissions)) {
        let l = userPermission.indexOf(btnPermissions) !== -1
        console.log(l);
        return l
        // return userPermission.indexOf(btnPermissions) !== -1
    }

    return true
}
